home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / Prograph Classic 2.6.1 / Examples / ProDraw / Sort XPrims • Read me < prev    next >
Encoding:
Text File  |  1991-10-02  |  1.4 KB  |  36 lines  |  [TEXT/ttxt]

  1.  
  2. Prograph Sort XPrims contains two primitives binlist-sort and binlist-find. binlist-sort sorts a list, binlist-find uses a binary search to find an element in a sorted list.
  3.  
  4.  
  5. binlist-sort
  6.  
  7.     Inputs: InList; [ AttributeName ]
  8.     Outputs: OutList
  9.  
  10.     Input Types: list; [ string ]
  11.     Output Types: list
  12.  
  13.     Sorts a list of numbers, strings or instances in ascending order.  Duplicates values are excluded from the sorted list. 
  14.  
  15.     If the second input,  AttributeName, is omitted, the input list must contain all strings or all numbers. 
  16.  
  17.     If AttributeName is specified, the list must contain instances with the specified attribute. The instances are sorted by the value of AttributeName. The values of AttributeName must be either all numbers or all strings. 
  18.  
  19.  
  20.  
  21.  
  22. binlist-find
  23.     
  24.     Inputs: TheList; TheItem; [ AttributeName ]
  25.     Outputs: Found; TheIndex
  26.  
  27.     Input Types: list; string | number; [ string ]
  28.     Outputs: boolean; integer 
  29.  
  30.     Uses a binary search to find an item in a sorted list. If TheItem is not found, TheIndex is the location in the list where TheItem can be inserted.
  31.  
  32.     If the second input,  AttributeName, is omitted, the input list must contain all strings or all numbers. 
  33.  
  34.     If AttributeName is specified, the list must contain instances with the specified attribute. The instances are searched by the value of AttributeName. The values of AttributeName must be either all numbers or all strings. 
  35.  
  36.